<template>
	<view>
		<view class="uni-flex uni-row">
			<view class="uni-flex-item" style="flex: 1;">
				<image v-bind:src="customerUser.headIconUrl" mode="scaleToFill" class="uni-header-image"></image>
			</view>
			<view class="uni-flex-item" style="align-self: center;flex: 4;">
				<text class="uni-text">{{customerUser.nickName}}</text>
			</view>
		</view>
		<view class="uni-flex uni-row">
			<view class="uni-flex-item icon-item" v-on:click="goEvaluationList()">
				<uni-icons type="compose"></uni-icons>
				<text>评价</text>
			</view>
			<view class="uni-flex-item icon-item">
				<uni-icons type="chat"></uni-icons>
				<text>消息</text>
			</view>
			<view class="uni-flex-item icon-item" v-on:click="goPetList()">
				<uni-icons type="qq"></uni-icons>
				<text>我的宠物</text>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcons from '../../components/uni-icons/uni-icons.vue'

	export default {
		components: {
			uniIcons
		},
		data() {
			return {
				data: "info",
				customerUser: {}
			}
		},
		onLoad: function() {
			uni.request({
				url: this.baseUrl + '/customerUser/getById?id=1',
				method: 'GET',
				data: {},
				success: res => {
					console.log(res);
					this.customerUser = res.data.data;
				},
				fail: () => {},
				complete: () => {}
			});
		},
		methods: {
			goEvaluationList: function() {
				uni.navigateTo({
					url: '../evaluationList/evaluationList',
				});
			},
			goPetList:function(){
				uni.navigateTo({
					url: '../petList/petList',
				});
			}
		}
	}
</script>

<style>
	.uni-header-image {
		height: 100upx;
		width: 100upx;
	}

	.icon-item {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 30upx 10upx;
		width: 25%;
		text-align: center;
		white-space: normal;
		word-break: break-all;
		box-sizing: border-box;
	}
</style>
